package com.fan.mapper;

import com.fan.entity.User;
import org.mybatis.spring.SqlSessionTemplate;

import java.util.List;

/**
 * @author およそ神
 * @version JDK 16
 * 所有的操作都使用setSqlSession来执行，现在改变成SqlSessionTemplate
 */
public class UserMapperImpl implements UserMapper{
   private SqlSessionTemplate sqlSession;

   public void setSqlSession(SqlSessionTemplate sqlSession) {
      this.sqlSession = sqlSession;
   }

   @Override
   public List<User> selectUser() {
      UserMapper mapper = sqlSession.getMapper(UserMapper.class);
      return mapper.selectUser();
   }
}
